/*
** events.h
** Defines event types and structure.
**
** Mathieu Garcia - mateo (at) bblk (dot) net
*/

/*
** The word we push on the event stack is structured like :
**
**    31                15               0 bit
** MSB [................][................] LSB
**        Event Type           Value
**
** It defines a type and a non-mendatory value.
**
**  .-----------------------.-----------------------.-----------------------------------.
**  |         EVENT         |         VALUE         |     DESCRIPTION                   |
**  |-----------------------|-----------------------|-----------------------------------|
**  | EVENT_SAMPLE_ONE_SHOT |        Sample ID      | Trigger sample #ID, one-shot      |
**  | EVENT_SAMPLE_LOOP     |        Sample ID      | Trigger sample #ID, looped        |
**  | EVENT_SAMPLE_STOP     |        Sample ID      | Stop sample #ID                   |
**  `_______________________+_______________________+___________________________________+
**
*/

/* Bit to set */
#define EVENT_SAMPLE_ONE_SHOT		(1 << 31)
#define EVENT_SAMPLE_LOOP		(1 << 30)
#define EVENT_SAMPLE_STOP		(1 << 29)

/* Accessor */
#define IS_SAMPLE_ONE_SHOT(x)	(x & EVENT_SAMPLE_ONE_SHOT)
#define IS_SAMPLE_LOOP(x)	(x & EVENT_SAMPLE_LOOP)
#define IS_SAMPLE_STOP(x)	(x & EVENT_SAMPLE_STOP)
#define GET_SAMPLE_ID(x)	(x & 0xffff)

